<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/page/share/taglib.jsp"%>
<%
    String root = request.getContextPath();
	response.setHeader("Cache-Control", "no-store"); //HTTP1.1
	response.setHeader("Pragma", "no-cache"); //HTTP1.0
	response.setDateHeader("Expires", 0);
%>
<form name="queryForm" id="queryForm" action="<%=root%>/batchCtl/batchMngt!listBatchInfo.do" method="post">
   <input type="hidden" name="curPageNo" id="currentPgNoHid" value="<s:property value="curPageNo" />" />
</form>
<div id="queryListDiv" >
    <h2 class="u-title">批次信息列表：</h2>
	<table class="datashow" style="width: 95%; table-layout: fixed;" cellpadding="0" cellspacing="0">
		<thead>
			<tr>
				<th width="10%" class="table_head">批次编号</th>
				<th width="10%" class="table_head">批次描述</th>
				<th width="10%" class="table_head">类型</th>
				<th width="10%" class="table_head">周期</th>
				<th width="10%" class="table_head">详细查看</th>
			</tr>
		</thead>
		<tbody>
			<s:if test="schedulePageInfo.records.size > 0">
				<s:iterator value="schedulePageInfo.records" var="batchInfo"
					status="status">
					<s:if test="#status.odd">
						<tr class="style1">
							<td><s:property value="#batchInfo.batchNo" /></td>
							<td><s:property value="#batchInfo.batchName" /></td>
							<td><s:property value="#batchInfo.runTypeToStr" /></td>
							<td><s:property value="#batchInfo.batchRunTime" /></td>
							<td class="txtCenter"><a href="#"
								onclick="findSubJob('<s:property value="#batchInfo.batchNo" />');">
									包括的任务 </a></td>
						</tr>
					</s:if>
					<s:else>
						<tr class="style2">
							<td><s:property value="#batchInfo.batchNo" /></td>
							<td><s:property value="#batchInfo.batchName" /></td>
							<td><s:property value="#batchInfo.runTypeToStr" /></td>
							<td><s:property value="#batchInfo.batchRunTime" /></td>
							<td class="txtCenter"><a href="#"
								onclick="findSubJob('<s:property value="#batchInfo.batchNo" />');">
									包括的任务 </a></td>
						</tr>
					</s:else>
				</s:iterator>
			</s:if>
			<s:else>
				<tr>
					<td><span style="color: blue">暂无记录！</span></td>
				</tr>
			</s:else>
		</tbody>
	</table>

	<table class="datashow" style="width: 95%; table-layout: fixed;" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100%" align="center"><SPAN class="pagebanner">
		共<label id="allSize">${schedulePageInfo.totalrecord}</label>条记录&nbsp;&nbsp;&nbsp; <label
			id="currentPage">${schedulePageInfo.currentpage}</label>/<label id="allPages">${schedulePageInfo.totalpage}</label>页
		&nbsp;&nbsp;&nbsp; 		
		 <input type="button" value="转至"
					  onclick="myGotoPage(); " />
			<input  type="text" style="width: 45px; text-align: center;" id="changePageTo" 
						name="changePageTo"  value="${schedulePageInfo.currentpage }"></input>页 &nbsp;&nbsp;&nbsp;
												
		<a href="#" onclick="myPrePage();"> <IMG
			src="<%=root%>/resources/images/btn_arrowback.jpg"></a>&nbsp;
		<a href="#" onclick="myNextPage();"> <IMG
			src="<%=root%>/resources/images/btn_arrowforward.jpg"></a>
		</SPAN>
		</td>
	</tr>
</table>
	
<div id="jobInfoDiv"></div>
<div id="stepInfoDiv"></div>
</div>

	 
	     
<script type="text/javascript">

function findSubJob(batchNOVal) {
	var _ctx = "<%=root%>";
    var url = _ctx + "/batchCtl/batchMngt!jobsFromBatch.do";
	$.get(url, {
		batchNo : batchNOVal
	}, function(data, textSatus) {
		$("#jobInfoDiv").html(data);
	});
}

</script>